package com.example.javafx.矩形椭圆;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.effect.DropShadow;
import javafx.scene.paint.Color;
import javafx.scene.shape.Ellipse;
import javafx.stage.Stage;

/**
 * 椭圆示例
 */
public class Main_2 extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("椭圆示例");
        Group root = new Group();
        Scene scene = new Scene(root,300,250, Color.WHITE);

        Group g = new Group();
        DropShadow ds = new DropShadow();//滤镜
        ds.setOffsetY(100.0);//偏移
        ds.setColor(Color.color(0.4,0.4,0.4));
        ds.setColor(Color.GREEN);

        Ellipse ellipse = new Ellipse();
        ellipse.setCenterX(50.0f);
        ellipse.setCenterY(50.0f);
        ellipse.setRadiusX(50.0f);
        ellipse.setRadiusY(25.0f);
        ellipse.setEffect(ds);

        g.getChildren().add(ellipse);
        root.getChildren().add(g);

        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
